home *** CD-ROM | disk | FTP | other *** search
- Path: nntp.hut.fi!nntp!hakola
- From: hakola@snakemail.hut.fi (Petri Hakola)
- Newsgroups: comp.lang.c
- Subject: Binary Tree and MSC/C++7.00
- Followup-To: comp.lang.c
- Date: 06 Jan 1996 22:28:25 GMT
- Organization: Capten Napalm`s Thermonuclear League of Liberty
- Distribution: world
- Message-ID: <HAKOLA.96Jan7002825@lk-hp-16.hut.fi>
- Reply-To: Petri.Hakola@hut.fi
- NNTP-Posting-Host: lk-hp-16.hut.fi
-
-
- It seems to me that I suffer some kind of partial amnesia. I
- can build a binary tree, add stuff to it, but how do I destroy
- it. I've tried nearly everyting, but there's either General
- Protection Error or some remains of prior members. I have
- quite embarassing feeling that I have forget something so
- obvious that it should almost 'hit the eye', but...
-
- if(root == NULL)
- return;
- delete_tree(root->left);
- free(root);
- delete_tree(root->right);
-
- Is this correct or ?
-
- And then some problems with strings. Is it common that while
- coding using Microsoft Programmers Workbench, strings aren't
- what they're supposed to be. For examble, if I use strncat to
- cut string from 100 char to 45 char, string is cut, but if I
- print it using printf, first 45 chars come out ok, but rest of
- the string is filled with smiling faces and all sorts of
- 'exotic' characters. Like '\0' isn't there or something...
-
- Any suggestions are very welcome, I'm quite stuck with these
- problems of mine.
-
- - Petri -
-